package com.base.system.jpa.entity;

import lombok.Data;
import org.hibernate.envers.Audited;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;

import javax.persistence.*;
import java.time.LocalDateTime;
@MappedSuperclass
@EntityListeners({JpaBaseEntity.class})
@Audited
@Data
public class JpaBaseEntity {
    @Column(updatable = false)
    private LocalDateTime createTime = LocalDateTime.now();

    private LocalDateTime lastUpateTime = LocalDateTime.now();
    @CreatedBy
    private String createBy;
    @LastModifiedBy
    private String updateBy;
}
